package com.example.demo.common;

/*
* 当前登录用户相关的操作
*
* */

import com.example.demo.entity.Userinfo;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

public class UserSessionUtils {


    /**
     * 得到当前的登录用户
     * */
    public static Userinfo getSessionUser(HttpServletRequest request){
        HttpSession session = request.getSession(false);
        if (session!=null && session.getAttribute(AppVariable.USER_SESSION_KEY)!=null){
            //说明用户已经正常登录了
            return (Userinfo) session.getAttribute(AppVariable.USER_SESSION_KEY);
        }
        return null;
    }


    //修改session中的头像信息





}
